如何获取某个animation当前播放动画的名称

您所在的位置:网站首页 动画 名字 如何获取某个animation当前播放动画的名称

如何获取某个animation当前播放动画的名称

2024-07-10 18:13| 来源: 网络整理| 查看: 265

https://github.com/cocos-creator/engine/blob/314ede133/cocos/spine/skeleton.ts#L206 /** * @en The name of current playing animation. * @zh 当前播放的动画名称。 * @property {String} animation */

get animation (): string { if (this.isAnimationCached()) { return this._animationName; } const entry = this.getCurrent(0); return (entry && entry.animation.name) || ''; } set animation (value: string) { if (value) { this.setAnimation(0, value, this.loop); this.destroyRenderData(); this.markForUpdateRenderData(); } else if (!this.isAnimationCached()) { this.clearTrack(0); this.setToSetupPose(); } }


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3